import Vue from 'vue'
import VueRouter from 'vue-router'
import orderlist from "@/views/Order/orderlist";
import article_post from "@/views/Article/article_post";
// import AddressManage from "@/views/profile/AddressManage";
const Home = () => import('../views/Home/Home')
const Shop = () => import('../views/Shop/Shop')
const School = () => import('../views/School/School')
const Profile = () => import('../views/profile/Profile')
const Login =() => import('../views/login/Login')
const Register =() => import('../views/register/Register')
const Setting =() => import('../views/profile/Setting')
const Info =() => import('../views/profile/Info')
const Address =() => import('../views/profile/Address')
const AddressManage =() => import('../views/profile/AddressManage')
const address_increase=() => import('../views/profile/adress_increase')
const Cart =()  => import('../views/Cart/Cart')
const Detail =() => import('../views/Shop/Detail/Detail')
const History_Goods=() => import('../views/profile/history/History')
const Order=() => import('../views/Order/orders')
const AddressChoice=()=>import('../views/Order/address_choice')
const Orderlist=() => import('../views/Order/orderlist')
const Article_post=() => import('../views/Article/article_post')
const ForumDetail=() => import('../views/Article/ForumDetail')
const ForumType=() => import('../views/Article/ArticleList')
const EditMessage=() => import('../views/profile/EditMessage')
const Bd_Agree=() => import('../views/School/Badminton_agree')
const Border=() => import('../views/School/Border')
const Test=() =>import('../views/Article/test')
const Active_Hold=() => import('../views/School/Ball_Together')
const Boder_Info=() => import('../views/School/Border_Info')
Vue.use(VueRouter)

const routes = [
  {
    path: '',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/shop',
    component: Shop,
    children:[

    ]
  },
  {
    path: '/school',
    component: School
  },
  {
    path: '/profile',
    component: Profile,


  },
  {
    path: '/login',
    component:Login
  },
  {
    path: '/register',
    component:Register}
, {
        path:'/setting',
        component:Setting
      },
    {
        path:'/info',
        component:Info
      },
    {
        path:'/address',
        component:Address
      },  {
        path:'/addressmanage',
        component:AddressManage
      },
    {
        path:'/address_increase',
        component:address_increase
      },
         {
        path:'/cart',
        component:Cart
      },
            {
    path: '/detail/:iid',
    component:Detail
  },
    {
    path: '/history_goods',
    component:History_Goods
  },
    {
    path: '/orders',
    component:Order
  },
    {
    path: '/addresschoice',
    component:AddressChoice
  },
  {
     path: '/orderlist',
    component:Orderlist
  },
      {
     path: '/article/post',
    component:Article_post
  },
      {
    path: '/article/:iid',
    component:ForumDetail
  },
          {
    path: '/articletype/:ordering',
    component:ForumType
  },
              {
    path: '/editMessage',
    component:EditMessage
  },
                  {
    path: '/school/badminton/agree',
    component:Bd_Agree
  },
     {
    path: '/school/badminton/border',
    component:Border
  },
         {
    path: '/test',
    component:Test
  },
             {
    path: '/active/hold',
    component:Active_Hold
  },
                 {
    path: '/activity/:iid',
    component:Boder_Info
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
const originalPush=VueRouter.prototype.push
VueRouter.prototype.push =function push(location){
  return originalPush.call(this,location).catch(err => err)
}
export default router
